package laf.socf.simulator.sensors;

import laf.socf.simulator.SensorServer;
import laf.socf.simulator.gui.Robot;
import org.freedesktop.dbus.DBusInterface;

/**
 *
 * @author laf
 */
public class GPS implements DBusInterface, Sensor {

    private Robot robot;
    private int count;

    public GPS() throws Exception {
    
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public GPS(Robot robot, int count) throws Exception {
        this.robot = robot;
        this.count = count;
        init();
    }

    public void init() throws Exception {
        SensorServer.getInstance().exportObject("/server/GPS" + this.count,
               this);
    }

    public boolean isRemote() {
        return true;
    }

    public double[] getLocation() {
            return new double[] { robot.getX(), robot.getY() };
    }

    public String getSensorName() {
        return "GPS";
    }

    public void startSensor() {
    }

    public void stopSensor() {
    }

}
